package com.jprocms.module.cms.api;

import com.jpro.framework.common.pojo.CommonResult;
import com.jprocms.module.cms.api.vo.BpmDeployReqVO;
import com.jprocms.module.cms.service.channel.ChannelService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import static com.jpro.framework.common.pojo.CommonResult.success;

@RestController // 提供 RESTful API 接口，给 Feign 调用

@Validated
public class ChannelApiImpl implements ChannelApi {
    @Resource
    private ChannelService channelService;

    @Override
    public CommonResult<Boolean> updateChannelWorkflowDefinitionId(@RequestBody BpmDeployReqVO bpmDeployMessage) {
        channelService.updateChannelWorkflowDefinitionId(bpmDeployMessage);
        return success(true);
    }
}
